package com.example.cloud.model.finance;

import com.example.cloud.model.common.CommonModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.math.BigDecimal;

/**
 * Created by wangtao on 2018/7/30.
 * 消费记录
 */
@Entity(name = "finance_consume_record")
@Data
@EqualsAndHashCode(callSuper = false)
public class ConsumeRecord extends CommonModel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    // 购买会员
    @Column(name = "patient_id")
    private Long patientId;
    // 会员主键
    @Column(name = "member_id")
    private Long memberId;
    // 会员名称
    @Column(name = "member_name")
    private String memberName;
    // 会员编号
    @Column(name = "member_number")
    private String memberNumber;
    // 交费类型{1: 正常交费 2：欠费补交}
    @Column(name = "payment_type")
    private int paymentType;
    // 应付金额
    @Column(name = "pay_amount", precision = 12, scale = 2)
    private BigDecimal payAmount;
    // 优惠金额
    @Column(name = "discount_amount", precision = 12, scale = 2)
    private BigDecimal discountAmount;
    // 抵扣金额
    @Column(name = "deduct_amount", precision = 12, scale = 2)
    private BigDecimal deductAmount;
    // 实付金额
    @Column(name = "actual_amount", precision = 12, scale = 2)
    private BigDecimal actualAmount;
    @Transient
    private PaymentDetails paymentDetails;
}
